package com.lc.SlidingPaneUnit;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import com.example.japaneseapp.R;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.lc.adapter.ListWordAdapter;
public class WordFragment extends Activity{
	
	private ListView lvlistWord;
	private ListWordAdapter listWordAdapter;
	private int idUnit;
	private View v;
	private UnitFragment menu;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.rightside_word_pane);
		this.menu = new UnitFragment(this);
		menu.setMode(SlidingMenu.LEFT);
		lvlistWord = (ListView) v.findViewById(R.id.listWordEachUnit);
		idUnit = 0;
		listWordAdapter = new ListWordAdapter(WordFragment.this,
				R.layout.item_newword, NameUnit[idUnit]);
		lvlistWord.setAdapter(listWordAdapter);
	}
	
	
	
	
	public int NameUnit[] = {R.raw.unit1, R.raw.unit2,R.raw.unit3,R.raw.unit4,R.raw.unit5,
			R.raw.unit6, R.raw.unit7,R.raw.unit8,R.raw.unit9,R.raw.unit10,
			R.raw.unit11, R.raw.unit12,R.raw.unit13,R.raw.unit14,R.raw.unit15,
			R.raw.unit16, R.raw.unit17,R.raw.unit18,R.raw.unit19};
	
	public void setUnit(int idUnit) {
		this.idUnit = idUnit;
		lvlistWord = (ListView) v.findViewById(R.id.listWordEachUnit);
		listWordAdapter = new ListWordAdapter(WordFragment.this,
				R.layout.item_newword, NameUnit[idUnit]);
		lvlistWord.setAdapter(listWordAdapter);
	}

}
